package com.me.test;

import java.util.Scanner;

/**
 * @author Li
 * @Date 2023/4/7 16:58
 */
public class EvenOrOdd {
    public static void main(String[] args) {
        int mun = getNum();
        judge(mun);
    }

    /**
     * 通过键盘输入一个数字,得到该数值
     * @return
     */
    private static int getNum() {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个整数！");
        int num = scanner.nextInt();
        return num;
    }

    /**
     * 根据输入的数字判断奇偶性
     * @param mun
     */
    public static void judge(int mun){
        if (mun%2==0){
            System.out.println(mun+"为偶数");
        }else {
            System.out.println(mun+"为奇数");
        }
    }
}
